package xyz.xiangyushui.controller.membership.reserveDesserts;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class reserveDetail
 */
@WebServlet("/member/reserve/commodity")
public class reserveDetail extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public reserveDetail() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String storeId = null;String date=null;
		if(request.getParameter("store")!=null){
			storeId=request.getParameter("store").split("_")[1];
			date=request.getParameter("store").split("_")[0];
		}
		
		System.out.println(request.getAttribute("id"));
		request.setAttribute("storeId", storeId);
		request.setAttribute("date",date );
		request.setAttribute("commodity", request.getParameter("id"));
		request.getRequestDispatcher("/member/reserveDesserts/reserve.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
